API Documentation
Static Public Member Functions | List of all members
nkWinUi::ContentLoader Class Referencefinal

Allows to export and import content through their declaration files. More...

Static Public Member Functions

static nkExport::ExporterLoadResult inputData (const nkMemory::StringView &filePath)
 
static nkExport::ExporterLoadResult inputDataSources (const nkMemory::StringView &sources)
 
static bool outputData (const nkMemory::StringView &content, const nkMemory::StringView &path)
 
static bool saveObjectDeclaration (nkExport::Exportable *object, const nkMemory::StringView &pathFromData)
 
static Component * loadComponentDeclaration (const nkMemory::StringView &pathFromData)
 
static Component * processComponentSources (const nkMemory::StringView &sources)
 
static Component * processComponentTree (nkExport::Node *tree)
 
static Layout * loadLayoutDeclaration (const nkMemory::StringView &pathFromData)
 
static Layout * processLayoutSources (const nkMemory::StringView &sources)
 
static Layout * processLayoutTree (nkExport::Node *tree)
 
static Component * loadInterfaceDeclaration (const nkMemory::StringView &pathFromData)
 
static Component * processInterfaceSources (const nkMemory::StringView &sources)
 
static Component * processInterfaceTree (nkExport::Node *tree)
 

Detailed Description

Allows to export and import content through their declaration files.

Member Function Documentation

◆ inputData()

static nkExport::ExporterLoadResult nkWinUi::ContentLoader::inputData ( const nkMemory::StringView &  filePath)
static

Inputs data from a file and returns associated tree, if parsing can occur. It will use Json parsing.

Parameters
filePathThe file path, relative to working directory. See nkResources::ResourceManager for path naming convention.
Returns
The result after loading designated file.

◆ inputDataSources()

static nkExport::ExporterLoadResult nkWinUi::ContentLoader::inputDataSources ( const nkMemory::StringView &  sources)
static

Inputs data from memory and returns associated tree, if parsing can occur. It will use Json parsing.

Parameters
sourcesThe sources to parse.
Returns
The result after loading designated memory chunk.

◆ outputData()

static bool nkWinUi::ContentLoader::outputData ( const nkMemory::StringView &  content,
const nkMemory::StringView &  path 
)
static

Writes data to a file.

Parameters
contentThe content to write.
pathThe path, relative to working directory, to output the file to. See nkResources::ResourceManager for path naming convention.
Returns
If the data could succesfully be output (true) or not (false).

◆ saveObjectDeclaration()

static bool nkWinUi::ContentLoader::saveObjectDeclaration ( nkExport::Exportable *  object,
const nkMemory::StringView &  pathFromData 
)
static

Saves an exportable into a file.

Parameters
objectThe object to serialize and export.
pathFromDataThe path, relative to working directory, to output the file to. See nkResources::ResourceManager for path naming convention.
Returns
If the data could succesfully be output (true) or not (false).

◆ loadComponentDeclaration()

static Component* nkWinUi::ContentLoader::loadComponentDeclaration ( const nkMemory::StringView &  pathFromData)
static

Loads a component declaration, from a file.

Parameters
pathFromDataThe file path, relative to working directory. See nkResources::ResourceManager for path naming convention.
Returns
The parsed component if successful, nullptr else.

◆ processComponentSources()

static Component* nkWinUi::ContentLoader::processComponentSources ( const nkMemory::StringView &  sources)
static

Loads a component declaration, from memory.

Parameters
sourcesThe memory chunk to interpret.
Returns
The parsed component if successful, nullptr else.

◆ processComponentTree()

static Component* nkWinUi::ContentLoader::processComponentTree ( nkExport::Node *  tree)
static

Loads a component declaration, from an existing tree.

Parameters
treeThe tree to interpret.
Returns
The parsed component if successful, nullptr else.

◆ loadLayoutDeclaration()

static Layout* nkWinUi::ContentLoader::loadLayoutDeclaration ( const nkMemory::StringView &  pathFromData)
static

Loads a Layout declaration, from a file.

Parameters
pathFromDataThe file path, relative to working directory. See nkResources::ResourceManager for path naming convention.
Returns
The parsed Layout if successful, nullptr else.

◆ processLayoutSources()

static Layout* nkWinUi::ContentLoader::processLayoutSources ( const nkMemory::StringView &  sources)
static

Loads a Layout declaration, from memory.

Parameters
sourcesThe memory chunk to interpret.
Returns
The parsed Layout if successful, nullptr else.

◆ processLayoutTree()

static Layout* nkWinUi::ContentLoader::processLayoutTree ( nkExport::Node *  tree)
static

Loads a Layout declaration, from an existing tree.

Parameters
treeThe tree to interpret.
Returns
The parsed Layout if successful, nullptr else.

◆ loadInterfaceDeclaration()

static Component* nkWinUi::ContentLoader::loadInterfaceDeclaration ( const nkMemory::StringView &  pathFromData)
static

Loads a interface (Component mixed with Layout) declaration, from a file.

Parameters
pathFromDataThe file path, relative to working directory. See nkResources::ResourceManager for path naming convention.
Returns
The parsed root component of the interface if successful, nullptr else.

◆ processInterfaceSources()

static Component* nkWinUi::ContentLoader::processInterfaceSources ( const nkMemory::StringView &  sources)
static

Loads a interface (Component mixed with Layout) declaration, from memory.

Parameters
sourcesThe memory chunk to interpret.
Returns
The parsed root component of the interface if successful, nullptr else.

◆ processInterfaceTree()

static Component* nkWinUi::ContentLoader::processInterfaceTree ( nkExport::Node *  tree)
static

Loads an interface (Component mixed with Layout) declaration, from an existing tree.

Parameters
treeThe tree to interpret.
Returns
The parsed root component of the interface if successful, nullptr else.

The documentation for this class was generated from the following file: